package com.newcapec.lesson2;

public class Demo2 {
    public static void main(String[] args) {
        Person person1 = new Person(20, "张三", "男", "2020-11-11");
        Person person2 = new Person(person1);
        System.out.println(person1);
        System.out.println(person2);

        Car car = new Car("red","12345");
        Driver driver1 = new Driver(20, "张三", "男", "2020-11-11","0101001",car);
        Driver driver2 = new Driver(driver1);
        System.out.println(driver1);
        System.out.println(driver2);
        System.out.println("**********************************************");
        driver1.getCar().setColor("black");
        System.out.println(driver1);
        System.out.println(driver2);
    }
}
